package com.gao.jacksonconfig;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class JacksonConfigApplication {

    public static void main(String[] args) {
        SpringApplication.run(JacksonConfigApplication.class, args);
    }


    /**
     * 自定义Jackson的属性
     * @return
     */
    @Bean
    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer(){
        return jacksonObjectMapperBuilder -> jacksonObjectMapperBuilder.indentOutput(true);
    }

}
